import Vue from "vue";
import VueRouter from "vue-router";
import Login from "../views/Login.vue";
import Layout from "../layout/Index.vue";
import User from "../views/User.vue";
import Paper from '../views/Paper.vue'
import Course from '../views/Course.vue'
import CourseStu from '../views/CourseStu.vue'
import Question from '../views/Question.vue'
import Test from '../views/Test.vue'
import Judge from '../views/Judge.vue'

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/login",
    name: "Login",
    component: Login,
  },
  {
    path: "/layout",
    name: "Layout",
    component: Layout,
    redirect: "/user",
    children: [
      {
        path: "/user",
        component: User,
      },
      {
        path: "/question",
        component: Question,
      },
      {
        path: "/paper",
        component: Paper,
      },
      {
        path: "/course",
        component: Course,
      },
      {
        path: "/course-stu",
        component: CourseStu,
      },
      {
        path: "/test",
        component: Test,
      },
      {
        path: "/judge",
        component: Judge,
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
